package io.gitee.yxsnake.framework.core.enums;

import io.gitee.yxsnake.framework.core.utils.StringUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author snake
 * @description 租户状态
 * @since 2024/11/2 19:11
 */
@Getter
@AllArgsConstructor
public enum TenantStatus {
    /**
     * 正常
     */
    OK("0", "正常"),
    /**
     * 停用
     */
    DISABLE("1", "停用"),
    /**
     * 删除
     */
    DELETED("2", "删除");

    private final String code;
    private final String info;

    public static TenantStatus getInstance(String str) {
        for (TenantStatus value : values()) {
            if (StringUtils.contains(str, value.getCode())) {
                return value;
            }
        }
        throw new RuntimeException("'TenantStatus' not found By " + str);
    }
}
